To see the request and response arguments of the /spawn service, run the command:
ros2 interface show turtlesim/srv/Spawn
ROS service call
Now that you know what a service type is, how to find a service’s type, and how to find the structure of that type’s arguments, you can call a service using:
ros2 service call <service_name> <service_type> <arguments>
ros2 service call /clear std_srvs/srv/Empty
ROS2 Param List
Open another terminal and run:
ros2 param list
ROS2 Param Get
To display the type and current value of a parameter, use the command: ros2 param get <node_name> <parameter_name>
ros2 param get /turtlesim background_g
ROS2 Param Set
To change a parameter’s value at runtime, use the command: ros2 param set <node_name> <parameter_name> <value>
ros2 param set /turtlesim background_r 150
ROS2 Param Dump
To save your current configuration of /turtlesim’s parameters, enter the command:
ros2 param dump /turtlesim
ROS2 Param Load
Open another terminal and run:
ros2 param load /turtlesim ./turtlesim.yaml
Load Parameter File on Node Startup
To start the same node using your saved parameter values, use: ros2 run <package_name> <executable_name> --ros-args --params-file <file_name>
ros2 run turtlesim turtlesim_node --ros-args --params-file ./turtlesim.yaml
ROS2 Action
Open a new terminal and run:
ros2 run turtlesim turtlesim_node
Open another terminal and run:
ros2 run turtlesim turtle_teleop_key
Open another terminal and run:
ros2 service list
ROS2 Node Info
To see the list of actions a node provides, /turtlesim in this case, open a new terminal and run the command:
ros2 node info /turtlesim
open a new terminal and run the command:
ros2 node info /teleop_turtle
ROS2 Action List
Open another terminal and run:
ros2 action list
Command to show action and node info together:
ros2 action list -t
ROS2 Action Info
You can further introspect the /turtle1/rotate_absolute action with the command:
ros2 action info /turtle1/rotate_absolute
ROS2 Interface Show
To show data type together:
ros2 interface show turtlesim/action/RotateAbsolute
ROS2 Action send_goal
Now let’s send an action goal from the command line with the following syntax:
ros2 action send_goal <action_name> <action_type> <values><values> need to be in YAML format.